package stage.factory;

import java.util.HashMap;
import java.util.Map;

import stage.manager.HistoricalInfoService;
import stage.manager.HistoricalInfosService;
/**
 * the factory of services. 
 * @author remi liu(Liu Zhibin)
 * @version 0.0
 */
public class AppFactory {
	private Map<String,Object> appMap=new HashMap<String,Object>();
	private static AppFactory af;
	private AppFactory() throws Exception{
		appMap.put("HistoricalInfoService",new HistoricalInfoService());
		appMap.put("HistoricalInfosService",new HistoricalInfosService());
	}
	public static AppFactory instance() throws Exception{
		if(af==null){
			af=new AppFactory();
		}
		return af;
	}
	public Object getApp(String id){
		return appMap.get(id);
	}
}
